<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>橙黄主题购物车</title>
    <style>
        /* 全局样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background-color: #FFF8E1; /* 浅橙黄背景 */
            color: #333;
            min-height: 100vh;
        }
        
        /* 顶部导航栏 */
        .header {
            background-color: #FFA000; /* 主橙黄色 */
            color: white;
            padding: 15px 5%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .logo {
            font-size: 24px;
            font-weight: bold;
        }
        
        .nav-links a {
            color: white;
            text-decoration: none;
            margin-left: 20px;
            font-size: 16px;
            transition: all 0.3s;
        }
        
        .nav-links a:hover {
            text-decoration: underline;
        }
        
        /* 购物车主体 */
        .cart-container {
            width: 90%;
            max-width: 1200px;
            margin: 30px auto;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        
        .cart-header {
            background-color: #FFC107; /* 亮橙黄色 */
            padding: 15px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .cart-title {
            font-size: 22px;
            font-weight: bold;
            color: #333;
        }
        
        .cart-summary {
            font-size: 16px;
            color: #333;
        }
        
        /* 商品列表 */
        .cart-items {
            padding: 20px;
        }
        
        .cart-item {
            display: flex;
            padding: 20px 0;
            border-bottom: 1px solid #eee;
            align-items: center;
        }
        
        .item-image {
            width: 100px;
            height: 100px;
            object-fit: cover;
            border-radius: 5px;
            margin-right: 20px;
        }
        
        .item-details {
            flex: 1;
        }
        
        .item-name {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .item-desc {
            font-size: 14px;
            color: #666;
            margin-bottom: 10px;
        }
        
        .item-price {
            font-size: 18px;
            color: #E65100; /* 深橙黄色 */
            font-weight: bold;
        }
        
        .quantity-control {
            display: flex;
            align-items: center;
            margin-top: 10px;
        }
        
        .quantity-btn {
            width: 30px;
            height: 30px;
            background-color: #FFC107;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .quantity-input {
            width: 50px;
            height: 30px;
            text-align: center;
            margin: 0 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }
        
        .remove-btn {
            background-color: #FF5252;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 5px;
            cursor: pointer;
            margin-left: 20px;
        }
        
        /* 结算区域 */
        .checkout-section {
            padding: 20px;
            background-color: #FFF3E0; /* 浅橙黄色 */
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .total-price {
            font-size: 22px;
            font-weight: bold;
        }
        
        .total-price span {
            color: #E65100;
        }
        
        .checkout-btn {
            background-color: #FF6D00; /* 鲜艳橙黄色 */
            color: white;
            border: none;
            padding: 12px 30px;
            font-size: 16px;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .checkout-btn:hover {
            background-color: #E65100;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .cart-item {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .item-image {
                margin-bottom: 15px;
            }
            
            .checkout-section {
                flex-direction: column;
                align-items: flex-start;
            }
            
            .checkout-btn {
                margin-top: 15px;
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <header class="header">
        <div class="logo">橙黄购物</div>
        <nav class="nav-links">
            <a href="#">首页</a>
            <a href="#">商品分类</a>
            <a href="#">我的订单</a>
            <a href="#">个人中心</a>
        </nav>
    </header>
    
    <!-- 购物车主体 -->
    <div class="cart-container">
        <div class="cart-header">
            <div class="cart-title">我的购物车</div>
            <div class="cart-summary">共 <span id="item-count">3</span> 件商品</div>
        </div>
        
        <div class="cart-items">
            <!-- 商品1 -->
            <div class="cart-item">
                <img src="https://via.placeholder.com/100" alt="商品图片" class="item-image">
                <div class="item-details">
                    <div class="item-name">优质橙子 5kg装</div>
                    <div class="item-desc">新鲜采摘，香甜多汁，产地直供</div>
                    <div class="item-price">¥59.90</div>
                    <div class="quantity-control">
                        <button class="quantity-btn">-</button>
                        <input type="number" class="quantity-input" value="1" min="1">
                        <button class="quantity-btn">+</button>
                        <button class="remove-btn">删除</button>
                    </div>
                </div>
            </div>
            
            <!-- 商品2 -->
            <div class="cart-item">
                <img src="https://via.placeholder.com/100" alt="商品图片" class="item-image">
                <div class="item-details">
                    <div class="item-name">进口芒果 3kg装</div>
                    <div class="item-desc">泰国进口，果肉饱满，香甜可口</div>
                    <div class="item-price">¥89.90</div>
                    <div class="quantity-control">
                        <button class="quantity-btn">-</button>
                        <input type="number" class="quantity-input" value="2" min="1">
                        <button class="quantity-btn">+</button>
                        <button class="remove-btn">删除</button>
                    </div>
                </div>
            </div>
            
            <!-- 商品3 -->
            <div class="cart-item">
                <img src="https://via.placeholder.com/100" alt="商品图片" class="item-image">
                <div class="item-details">
                    <div class="item-name">新鲜柠檬 1kg装</div>
                    <div class="item-desc">酸爽清新，富含维生素C</div>
                    <div class="item-price">¥19.90</div>
                    <div class="quantity-control">
                        <button class="quantity-btn">-</button>
                        <input type="number" class="quantity-input" value="1" min="1">
                        <button class="quantity-btn">+</button>
                        <button class="remove-btn">删除</button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 结算区域 -->
        <div class="checkout-section">
            <div class="total-price">总计：<span>¥169.70</span></div>
            <button class="checkout-btn">去结算</button>
        </div>
    </div>
    
    <script>
        // 简单的交互功能
        document.querySelectorAll('.quantity-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const input = this.parentElement.querySelector('.quantity-input');
                let value = parseInt(input.value);
                
                if(this.textContent === '+') {
                    input.value = value + 1;
                } else {
                    if(value > 1) {
                        input.value = value - 1;
                    }
                }
                
                updateTotal();
            });
        });
        
        document.querySelectorAll('.remove-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                this.closest('.cart-item').remove();
                updateTotal();
            });
        });
        
        function updateTotal() {
            let total = 0;
            let itemCount = 0;
            
            document.querySelectorAll('.cart-item').forEach(item => {
                const priceText = item.querySelector('.item-price').textContent;
                const price = parseFloat(priceText.replace('¥', ''));
                const quantity = parseInt(item.querySelector('.quantity-input').value);
                
                total += price * quantity;
                itemCount += 1;
            });
            
            document.getElementById('item-count').textContent = itemCount;
            document.querySelector('.total-price span').textContent = '¥' + total.toFixed(2);
        }
    </script>
</body>
</html>